﻿using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text;

namespace DapperCore.Model
{
   public  class SetContext
    {
        public SetContext()
        {
            OrderbyExpressionList = new Dictionary<EOrderBy, LambdaExpression>();
        }

        /// <summary>
        /// 执行表的类型
        /// </summary>
        public Type TableType { get; internal set; }

        /// <summary>
        /// 条件语句
        /// </summary>
        public LambdaExpression WhereExpression { get; internal set; }

        /// <summary>
        /// 判断存在与否
        /// </summary>
        public LambdaExpression IfNotExistsExpression { get; internal set; }

        /// <summary>
        /// 排序规则
        /// </summary>
        public Dictionary<EOrderBy, LambdaExpression> OrderbyExpressionList { get; internal set; }

        /// <summary>
        /// 选择器
        /// </summary>
        public LambdaExpression SelectExpression { get; internal set; }

        /// <summary>
        /// 选择器类型
        /// </summary>
        public Type SelectType { get; set; }

        /// <summary>
        /// 当前页
        /// </summary>
        public int PageIndex { get; internal set; }

        /// <summary>
        /// 跳过数目
        /// </summary>
        public int SkipsNum { get; internal set; }
        
        /// <summary>
        /// 当前页码
        /// </summary>
        public int PageSize { get; internal set; }


        public bool NoLock { get; internal set; }
    }
}
